/**
 * @View
 * @class : VenuesShow.js
 * @author : Mustapha FERHAN
 * @function : interface that displays details of screenings of films and
 *           information of a given venues
 */
radio.views.FifmMenu = Ext
        .extend(
                Ext.TabPanel,
                {
                    id : 'tabMaster_ClassShow',
                    scroll : false,
                    fullscreen : true,
                    tabBar : {
                        dock : 'bottom',
                         layout : {
                         pack : 'center'
                        }
                    },


                    items : [
                            {
                                style:'background-color:Black;background-image:url(resources/img/logocapradio.png);background-size: 100% 70%;background-repeat:no-repeat;',
                                title : 'Description',
                                iconCls : 'info',
                                layout : 'hbox',
                                
                                items : [ {

                                    xtype : 'button',
                                    text : 'play',
                                    cls : 'radio-player',
                                    handler : function() {
                                        p.playAudio();
                                       //ci dessous volume changer
                                        // http://docs.phonegap.com/en/1.3.0/phonegap_events_events.md.html#volumedownbutton
                                    }
                                }, {

                                    xtype : 'button',
                                    text : 'pause',
                                    cls : 'radio-player',
                                    handler : function() {
                                        p.pauseAudio();
                                    }
                                },
                                {

                                    xtype : 'button',
                                    text : 'stop',
                                    cls : 'radio-player',
                                    handler : function() {
                                        p.stopAudio();
                                    }
                                }

                                ]

                            },
                            {
                                title : 'Acualités',
                                scroll : 'vertical',
                                iconCls : 'time',
                                xtype : 'list',
                                id : 'newsList',
                                store : radio.stores.News,
                                fullscreen : true,
                                emptyText : 'No_data_available',
                                itemTpl : new Ext.XTemplate(
                                        // '<tpl for=".">',
                                        '<div style="padding:8px">',
                                        '<div style="width:80px;height:60px; float:left; margin-right: 8px; background-repeat:no-repeat; background-position:50% 50%; background-size: 130%; background-image:url(\'{url}\');"/>',
                                        '</div>',
                                        '<span class:"sponsors-item-title">{title}</span>',
                                        // '<p>{date}</p>',
                                        // '<p>{auteur}</p>',
                                        '</div>'),

                                // grouped : true,
                                indexBar : true,
                                listeners : {

                                    itemTap : function(dataview, index, el, e) {
                                        record = dataview.store.getAt(index);
                                        Ext.dispatch( {
                                            controller : 'home',
                                            action : 'showInfo',
                                            historyUrl : 'home/showInfo',
                                            id : record.getId(),
                                            record : record,
                                            animation : {
                                                type : 'slide',
                                                direction : 'left'
                                            }

                                        });

                                    }
                                }

                            },                           
                            {
                                title : 'Partage',
                                scroll : 'vertical',
                                iconCls : 'team1',
                                html : '<div id="jquery_jplayer_1" class="jp-jplayer"></div>'+
                                    '<div id="jp_container_1" class="jp-audio">'+
                            '<div class="jp-type-single">'+
                             ' <div class="jp-gui jp-interface">'+
                               ' <ul class="jp-controls">'+
                                '  <li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>'+
                                '  <li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>'+
                                 ' <li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li>'+
                                 ' <li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a></li>'+
                                '  <li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>'+
                                '  <li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max volume</a></li>'+
                               ' </ul>'+
                              '  <div class="jp-progress">'+
                                '  <div class="jp-seek-bar">'+
                                '    <div class="jp-play-bar"></div>'+
                                '  </div>'+
                                '</div>'+
                               ' <div class="jp-volume-bar">'+
                               '   <div class="jp-volume-bar-value"></div>'+
                                '</div>'+
                                '<div class="jp-time-holder">'+
                               '  <div class="jp-current-time"></div>'+
                                '  <div class="jp-duration"></div>'+
                               '   <ul class="jp-toggles">'+
                                '    <li><a href="javascript:;" class="jp-repeat" tabindex="1" title="repeat">repeat</a></li>'+
                               '     <li><a href="javascript:;" class="jp-repeat-off" tabindex="1" title="repeat off">repeat off</a></li>'+
                                '  </ul>'+
                               ' </div>'+
                             ' </div>'+
                             ' <div class="jp-title">'+
                             '   <ul>'+
                              '    <li>Bubble</li>'+
                              '  </ul>'+
                             ' </div>'+
                             ' <div class="jp-no-solution">'+
                             '   <span>Update Required</span>'+
                              '  To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.'+
                             ' </div>'+
                           ' </div>'+
                          '</div>'

                            },
                            {
                                title : 'contact',
                                // xtype : 'list',
                                // scroll : 'vertical',
                                // id : 'listEventsMaster_Class',
                                iconCls : 'chat',
                                scroll : 'vertical',
                                html : "<div class='x-list-header'>Contact Cap Radio</div><div class='smallertext'><p>Tél.: 05 39 33 33 33</p>  <p>E-mail: contact@capradio.ma</p><p>Adresse : 14, Rue Farabi la plage 90 000 - Tanger - Maroc</p>  <p>Facebook: http://www.facebook.com/pages/Cap-Radio-Maroc/137074993023769</p><p>Twitter: http://twitter.com/Cap_Radio </p></div><div style='text-align:center;'><a id='capradioSite' href='http://www.capradio.ma'><img width='200' src='resources/img/logo.png'><p>www.capradio.ma</p></a></div>"
                           
                    }]

                    ,
                    initComponent : function() {
                        radio.views.FifmMenu.superclass.initComponent.apply(
                                this, arguments);
                    }
                });
Ext.reg('FifmMenu', radio.views.FifmMenu);
function onSuccess() {
    console.log("playAudio():Audio Success");
}

// onError Callback
//
